﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace B6_Appllication
{
    public partial class TempConverterWebForm : System.Web.UI.Page
    {
        private B6_REF.TemperatureConverterService reference;

        protected void Page_Load(object sender, EventArgs e)
        {
            reference = new B6_REF.TemperatureConverterService();
        }

        protected void ButtonCel_Click(object sender, EventArgs e)
        {
            int val = Int32.Parse(this.TextBoxCelsius.Text);
            this.TextBoxFar.Text = (reference.convertCelsiusToFahrenheit(val)).ToString();
            this.TextBoxKel.Text = (reference.convertCelsiusToKelvin(val)).ToString();
        }

        protected void ButtonFar_Click(object sender, EventArgs e)
        {
            int val = Int32.Parse(this.TextBoxFar.Text);
            this.TextBoxCelsius.Text = (reference.convertFahrenheitToCelsius(val)).ToString();
            this.TextBoxKel.Text = (reference.convertFahrenheitToKelvin(val)).ToString();
        }

        protected void ButtonKel_Click(object sender, EventArgs e)
        {
            int val = Int32.Parse(this.TextBoxKel.Text);
            this.TextBoxCelsius.Text = (reference.convertKelvinToCelsius(val)).ToString();
            this.TextBoxFar.Text = (reference.convertKelvinToFahrenheit(val)).ToString();
        }

    }
}
